package Utils;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Sound;

public class SoundManager {
	private static SoundManager instance = null;
	
	// Music in game
	Sound mMusic_MainBackground; // Main Background
	Sound mMusic_GameOver; // Game Over
	Sound mMusic_GameVictory; // Game Victory
	
	// Sound in game
	Sound mSCut; // Cut
	Sound mSJump; // jump
	Sound mSDie; // Boom
	Sound mSMonsterDeath; // Monster Death
	Sound mSSelectMenu; // Select Menu
	Sound mSSwitchMenu; // Switch Menu

	public static SoundManager getInstance() {
		if(instance == null) {
			instance = new SoundManager();
		}
		return instance;
	}
	public Sound loadSound(String filePath) {
		return Gdx.audio.newSound(Gdx.files.internal(filePath));
	}
	
	public Sound getSoundCut() {
		return loadSound("Sounds/Cut.wav");
	}
	
	public Sound getSoundJump() {
		return loadSound("Sounds/Jump.mp3");
	}
	
	public Sound getSoundDie() {
		return loadSound("Sounds/Boom.ogg");
	}
	
	public Sound getSoundMonsterDeath() {
		return loadSound("Sounds/MonsterDeath.ogg");
	}
	
	public Sound getSoundSelectMenu() {
		return loadSound("Sounds/SelectMenu.mp3");
	}
	
	public Sound getSoundSwitchMenu() {
		return loadSound("Sounds/switchMenu.mp3");
	}
	
	public Sound getMusicMainBackground() {
		return loadSound("Sounds/MainBackground.mp3");
	}
	
	public Sound getMusicGameOver() {
		return loadSound("Sounds/GameOver.ogg");
	}
	
	public Sound getMusicGameVictory() {
		return loadSound("Sounds/GameVictory.ogg");
	}
	
	public void playSound(Sound s) {
		s.play();
	}
	
	public void stopSound(Sound s) {
		s.stop();
	}
	
	public void playSoundWithLoop(Sound s) {
		s.loop();
	}
	
}
